package com.hwadee.teachingprocessmanagementsystem.controller.base;

import com.hwadee.teachingprocessmanagementsystem.annotation.Role;
import com.hwadee.teachingprocessmanagementsystem.annotation.RoleAuthorizationAnnotation;
import com.hwadee.teachingprocessmanagementsystem.util.result.DataResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: Token管理
 * @Author: Jukomu
 * @Package: com.example.springbootdemo.controller
 * @Project: SpringBoot-demo
 * @name: TokenController
 * @Date: 2024/7/8-16:29
 * @Filename: TokenController
 */
@RestController
@RequestMapping("token")
public class TokenController {
    /**
     * 验证token有效性
     * @param token
     * @return
     */
    @RequestMapping("verify")
    @RoleAuthorizationAnnotation(Role.USER)
    public DataResult<Object> verifyToken(@RequestParam("token") String token) {
//        System.out.println("**********Verifying token***************  " + token);
        return DataResult.succ();
    }
}
